<?php

namespace App\Http\Resources\AuthResources;

use App\Http\Resources\Resource;
use Illuminate\Support\Facades\Auth;
use App\Models\User;
use Carbon\Carbon;

class UserInfoResource extends Resource
{
    public function toArray($request)
    {
        /** @var User $user */
        $user = Auth::user();
        return [
            'id' => $this->id,
            'avatar' => $this->avatar,
            'username' => $this->username,
            'email' => $this->email,
            'mobile' => $this->mobile,
            'invite_link' => config('image.invite') . "/user/reg",
            'pay_password_status' => $this->pay_password ? 1 : 0,
            'vip_level' => $this->vip_level,
            'invitation_code' => $this->invitation_code,
        ];
    }
}
